package com.freedom.ums.member.interfaces.controller.app;

import com.freedom.common.core.result.CommonResult;
import com.freedom.ums.member.application.service.cmd.AuthCmdService;
import com.freedom.ums.member.infrastructure.persistence.pojo.command.app.MemberRegisterCommand;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "「App端」用户认证管理")
@RestController
@RequestMapping("/api/v1/auth")
@RequiredArgsConstructor
public class AuthController {

    private final AuthCmdService authCmdService;

    @ApiOperation(value = "会员手机注册")
    @PostMapping("/sms/register")
    public CommonResult<Boolean> smsRegister(@RequestBody @Validated MemberRegisterCommand memberRegisterCommand) {
        return CommonResult.success(authCmdService.smsRegister(memberRegisterCommand));
    }
}
